import request from "@/utils/request";

// 查询列表
export function getActivityList(query) {
  return request({
    url:
      "/app/activity/list?pageNum=" +
      query.pageNum +
      "&pageSize=" +
      query.pageSize,
    method: "post",
    data: query.data,
  });
}
// 删除
export function delActivityList(ids) {
  return request({
    url: "/app/activity/" + ids,
    method: "delete",
  });
}

// 查询详细
export function getActivityListItem(ids) {
  return request({
    url: "/app/activity/" + ids,
    method: "get",
  });
}

// 新增
export function addActivityListItem(data) {
  return request({
    url: "/app/activity",
    method: "post",
    data: data,
  });
}

// 修改
export function updateActivityListItem(data) {
  return request({
    url: "/app/activity",
    method: "put",
    data: data,
  });
}
// 查询详细数据-已废弃
export function getActivityListDetail(ids) {
  return request({
    url: "/app/activity/id?activityId=" + ids,
    method: "get",
  });
}
// 促销活动关联经销商
export function addCustomerList(data) {
  return request({
    url: "/app/activity/customer",
    method: "post",
    data: data,
  });
}
export function delCustomerList(ids) {
  return request({
    url: "/app/activity/customer/" + ids,
    method: "delete",
  });
}
// 促销活动关联货品
export function addGoodsList(data) {
  return request({
    url: "/app/activity/goods",
    method: "post",
    data: data,
  });
}
export function delGoodsList(ids) {
  return request({
    url: "/app/activity/goods/" + ids,
    method: "delete",
  });
}
// 审核
export function processActivityListItem(data) {
  return request({
    url: "/app/activity/process",
    method: "put",
    data: data,
  });
}
// 发布
export function releaseActivityListItem(data) {
  return request({
    url: "/app/activity/release",
    method: "put",
    data: data,
  });
}
